home *** CD-ROM | disk | FTP | other *** search
- Device-Handler Device-Handler
-
- $VER: Device-Handler 1.4 (22 Feb 1995)
-
- Original code was written by Matthias Scheler. The original
- distribution archive of Matthias has been included.
-
-
- NAME
- Device-Handler - UNIX-like raw device access
-
- WARNING
- This software is intended for advanced users only. I *strongly*
- recommend all people who do not understand every detail given
- herein to obtain further information about ->AmigaDOS-Devices
- and ->Handlers and their implementation on top of ->Exec
- device drivers.
-
- ** WRONG USAGE OF THIS SOFTWARE WILL MOST LIKELY RESULT IN **
- ** SEVERE LOSS OF DATA! **
-
- As this software is freeware in cases of data disruption you
- will find _nobody_ being responsible except yourself. Especially
- Matthias and me reject any liability.
-
- FUNCTION
- Amiga Users often put a jealous glance to the UNIX world, were
- raw device access is as simple as nowhere else. Several solutions
- to fix this for Amigas have been provided in the past. One of these,
- the DEV: handler by Matthias Scheler, has been taken to base this
- software on.
-
- Specifically, the original DEV: has the considerable drawback that it
- only worked with devices that supported the ->TD_GETGEOMETRY
- ->IORequest. Unfortunatly a lot of harddisk- (and other) drivers don't
- implement this command.
-
- So I decided to derive the Exec-device selection from on the AmigaDOS
- stream name in such way, that the user provides the Name of an
- AmigaDOS Handler instead of the Exec-Device. There are system conform
- ways to find out on top of which Exec-device an AmigaDOS handler is
- running, so why not leaving this job to the DEV:-Handler ?
-
- With my DEV: enhancement, you may type things like "DEV:df0" or
- "DEV:dh0", you get the general idea. Further improvements include the
- ability to limit the total size which is allowed to read or write, and
- to specify the low- and high cylinders to be used.
-
- Note that the physical definition is completely retrieved from the
- given handler name (e.g. dh0), so there are some implications:
-
- * Exec-device will be always correct
- * Exec-device unit will be allways correspond to the unit
- the AmigaDOS handler works on, releasing you from dealing whith
- it and thus making the usage of DEV: _much_ safer!
- * Exec-device OpenDevice() flags are always correct
- * Exec-device buffer memory type is always correct
- * Most often you will want to use DEV: for ->UNIX tar and will want
- to start writing exactly at block 0. For most floppy-base devices
- this will be correct automatically. In contrast, nearly every
- harddisk contains a ->RigidDiskBlock and the actual partitions
- are located behind this, usually having a low-cylinder of about 3.
- To archieve the intended bahaviour, you should create a special
- DOSDriver/mountlist entry, such as:
-
- RDH0: /* raw dh0 */
- Device = scsi.device /* change this accordingly */
- Unit = 1
- Flags = 0
- Surfaces = 5
- BlocksPerTrack = 17
- LowCyl = 0 ; /* specify here full range */
- HighCyl = 1023 /* of cylinders */
- Stacksize = 4000
- Priority = 5
- GlobVec = -1
- BufMemType = 0
- #
-
- Another way is to use the LOCYL stream name option. Again note:
- Playing around with LOCYL or HICYL is a pretty dangerous thing.
- It is always advised to write a dedicated mountlist/DOSDriver.
-
- Plead read also the original documentation of the DEV:-handler.
-
- STREAM NAME
-
- The stream name is constructed as following:
-
- DEV:<DOSHANDLER>[/<MAXLEN>][/LOCYL=<NUM>][/HICYL=<NUM>]
-
- During stream name processing, all slashes are removed, thus creating
- a standard AmigaDOS ReadArgs()-style text line, as you know it from
- all CLI-Programs (I suppose you deleted all those that don't use
- ReadArgs() ;).
-
- Additionally, all dots ('.') which are not part of a quoted text, are
- substituted by an equation symbol ('='). That comes in handy when using
- the LOCYL or HICYL options. AmigaDOS strips all equations that are not
- quoted. Thus, the command "type dev:df0/locyl=3" would lead to an error,
- as the handler would get the text "dev:df0/locyl" instead of
- "dev:df0/locyl=3". So, either use the dot or quote the whole stream spec.
-
- *Any* number which is to pass to the handler may start with '$' or '0x'
- or '0X' to indicate hexadecimal notation (default is decimal). A
- trailing 'M' tells the handler to interprete it as a mega-value,
- (i.e. multiply by 1024^2) and 'K' to signal a kilo value (factor 1024).
- All charactes are case-insensitive.
-
- The complete convenience of ReadArgs() applies to stream name
- construction:
-
- The template is "DOSHANDLER/A,MAXLEN,LOCYL/K,HICYL/K"
-
- DOSNAME
- A valid, AmigaDOS-device name such as DH0, df0, ... The device has
- to be mounted, though.
-
- MAXLEN
- optional: maximum length of bytes to read or write. The (final)
- lo/hicyl may enclose a smaller space: the smallest space is always
- used. This value _must_ appear anywhere behind DOSHANDLER.
-
- LOCYL
- Starting cylinder read from/write to. If higher than the (final)
- high cylinder, low cylinder is casted to high cylinder.
-
- HICYL
- Ending cylinder. If higher than physical, physical is used.
-
- Some example stream names:
-
- DEV:df0
- DEV:dh0/1024
- DEV:dh0/1k
- DEV:dh0/LOCYL=0
- DEV:dh1/HICYL=1k/LOCYL=0M/20M
- DEV:df0/$1000
- DEV:df0/0x2000/LOCYL.4
- "DEV:df0/0X200/LOCYL=4"
-
- AUTHOR
-
- Marius Gröger,
- Bärstadter Str. 4
- D-65307 Bad Schwalbach
- email: mag@sysgo.de
-
- SOURCE
-
- The source code of "Device-Handler" has been written with the GoldED
- text editor (© Dietmar Eilert). Text folds start with "/*F*/"
- and end with "/*E*/".
-
- You may make any changes to the source for your own use.
- If you consider them useful for everybody, tell me so I can
- include them to the next public release.
-
- The documentation has been extracted with makedoc (© Stefan Ruppert).
-
- $HISTORY:
-
- 22 Feb 1995 : 001.004 : some bug-fixing
- 18 Feb 1995 : 001.003 : made Write() working...
- 20 Dec 1994 : 001.002 : + one task/multiple FileHandles
- + source-code rework
- + better stream name scanning by ReadArgs()
- + new option MAXLENGTH
- + new options LOCYL, HICYL
- + highly improved read/write operation
- 18 Dec 1994 : 001.001 : changed stream name convention
- 08 Dec 1994 : 001.000 : took over from Matthias Scheler
-
-